﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

#pragma once
#include "GmFamilyService.h"
#include "IFamilyConnector3d.h"
#include "ContainerUtil.h"
#include "GccpConnectorEnums.h"

namespace gcmp
{
    class IGraphicsBRepEdge;
}

namespace gfam
{
    /// \brief 市政连接件
    class GM_FAMILY_SERVICE_EXPORT IFamilyMunicipalConnector : public IFamilyConnector3d
    {
        DEFINE_CAST_DERIVED(gfam::IFamilyMunicipalConnector, gfam::IFamilyConnector3d)

    public:
        /// \brief 创建市政连接件
        ///
        /// \param pDocument 文档指针，输入为空时，创建市政连接件失败，返回nullptr
        /// \param pNodeReference 连接件引用对象
        /// \param pEdges 连接件引用对象(边的图形节点)
        /// \param pConnectorShape 连接件形状
        /// \param pConnectorType 连接件类型
        /// \return 创建成功返回市政连接件指针，创建失败返回nullptr
        static IFamilyMunicipalConnector* Create(gcmp::IDocument* pDocument, const gcmp::IGraphicsNodeReference* pNodeReference, const gcmp::GraphicsNodeReferenceOwnerPtrVector& pEdges, const IFamilyConnectorShape *pConnectorShape, const IFamilyConnectorType *pConnectorType);

        /// \brief 创建市政连接件
        ///
        /// \param pDocument 文档指针，输入为空时，创建市政连接件失败，返回nullptr
        /// \param pNodeReference 连接件引用对象
        /// \param pEdges 连接件引用对象(边)
        /// \param pConnectorShape 连接件形状
        /// \param pConnectorType 连接件类型
        /// \return 创建成功返回市政连接件指针，创建失败返回nullptr
        static IFamilyMunicipalConnector* Create(gcmp::IDocument* pDocument, const gcmp::IGraphicsNodeReference* pNodeReference, std::vector<const gcmp::IGraphicsBRepEdge*> pEdges, const IFamilyConnectorShape *pConnectorShape, const IFamilyConnectorType *pConnectorType);
        /// \brief 获取连接件连接方式
        /// 
        /// \return 连接件连接方式
        virtual ConnectionType GetConnectionType() const = 0;

        /// \brief 设置连接件连接方式
        /// 
        /// \param connectionType 连接件连接方式
        virtual void SetConnectionType(const ConnectionType& connectionType) = 0;

        /// \brief 获取连接件壁厚
        /// 
        /// \return 连接件壁厚
        virtual double GetWallThickness() const = 0;

        /// \brief 设置连接件壁厚
        /// 
        /// \param wallThickness 连接件壁厚
        virtual void SetWallThickness(double wallThickness) = 0;

        /// \brief 获取连接件系统类型
        ///
        /// \return 连接件系统类型
        virtual GccpConnectorSystemType GetSystemType() const = 0;

        /// \brief 设置连接件系统类型
        ///
        /// \param type 连接件系统类型
        virtual void SetSystemType(const GccpConnectorSystemType& type) = 0;

        /// \brief 获取与之关联的机电连接点的ElementId
        ///
        /// \return 与之关联的机电连接点的ElementId
        virtual gcmp::ElementId GetLinkedConnectorElementId() const = 0;

        /// \brief 获取Implementation Uid
        ///
        /// \return UniIdentity 返回ImplementationUid
        static gcmp::UniIdentity GetImplementationUid();
    };

} 
